using System.ComponentModel.DataAnnotations;
using FytSoa.Domain.User;
using SqlSugar;

namespace FytSoa.Domain.Cm;

/// <summary>
/// 社区内容
/// </summary>
[SugarTable("cm_community")]
public class CmCommunity:Entity
{
    /// <summary>
    /// 用户编号
    /// </summary>
    [Required]
    public long UserId { get; set; }
    
    /// <summary>
    /// 用户
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(UserId))]
    public Member User { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }

    /// <summary>
    /// 简介
    /// </summary>
    [Required]
    [StringLength(900)]
    public string Summary { get; set; }

    /// <summary>
    /// 图片列表
    /// </summary>
    [SugarColumn(IsJson = true)]
    public List<string> ImageArr { get; set; } = new();

    /// <summary>
    /// 视频地址
    /// </summary>
    public string VideoUrl { get; set; }

    /// <summary>
    /// 点赞数量
    /// </summary>
    [Required]
    public int Praise { get; set; } = 0;

    /// <summary>
    /// 评论数量
    /// </summary>
    [Required]
    public int Comment { get; set; } = 0;

    /// <summary>
    /// 分享数量
    /// </summary>
    [Required]
    public int Share { get; set; } = 0;

    /// <summary>
    /// 审核状态
    /// </summary>
    [Required]
    public bool Status { get; set; } = false;

    /// <summary>
    /// 是否推荐
    /// </summary>
    [Required]
    public bool IsTop { get; set; } = false;

    /// <summary>
    /// 创建时间
    /// </summary>
    [Required]
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    public string CreateUser { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    public string UpdateUser { get; set; }


}